package exam;

import java.util.ArrayList;
import java.util.List;

public class exam2 {

    public static void main(String[] args) {
        exam2_emp e=new exam2_emp("张三",2000);
        exam2_emp e2=new exam2_emp("李四",1500);
        exam2_emp e3=new exam2_emp("王二",2800);
        exam2_emp e4=new exam2_emp("David",2000);
        exam2_emp e5=new exam2_emp("Peter",1500);
        List<exam2_emp> list=new ArrayList<>();
        list.add(e);
        list.add(e2);
        list.add(e3);
        list.add(e4);
        list.add(e5);
        for (int i=0;i< list.size()-1;i++){
            for (int j=i+1;j< list.size();j++){
                if (list.get(i).getPrice().equals(list.get(j).getPrice())){
                    System.out.println("相同:"+list.get(i).getName()+"\t工资为："+list.get(i).getPrice()+"\t\t\t"
                            +list.get(j).getName()+"\t工资为："+list.get(j).getPrice());
                }
            }
        }

    }
}
